<?php
namespace app\serverrecommend\validate;
use \app\manage\validate\BaseValidate;

class Recommend extends BaseValidate
{
    
	protected $rule =   [
        'app_id'  => ['integer','gt'=>0],
        'is_public' => ['in'=>'0,1'],
        'action' => ['min'=>2],
        'name'  => ['length'=>'2,25'],
        'id'    => ['integer','gt'=>0],
    	'pid'   => ['integer','egt'=>0],
    	'order' => ['integer','egt'=>0],
    	'status'=> ['in'=>'0,1'],
    ];

    protected $message  =   [
        'name'     => '名称在2-25个字符之间',
        'pid.integer'   => '上级分类错误',
        'order.integer' => '排序为整数',
        'status'       => '状态错误',
    ];

    protected $scene = [
        'edit' => ['app_id'=>['require','integer','gt'=>0],'is_public','name','id'=>['require','integer','gt'=>0],'order','action'],
        'getTree' => ['app_id'=>['require','integer','gt'=>0],'id'=>['require','integer','egt'=>0]],
    ];

}